
#include "InterposeState.h"

InterposeState::InterposeState(): 
	mCameraMan(nullptr), 
	running(false)
{}

void InterposeState::Enter(int prevState)
{
	createScene();
	GameServices::InputManager()->AddListener(this);
	running = true;
}

bool InterposeState::IsRunning()
{
	return running;
}

void InterposeState::Pause()
{
	//Code to pause all object in the state

	//Turn off interpose
	GameServices::ObjectManager()->GetAutonomousObject(0)->Steering()->InterposeOff();

	//Turn wall avoidance off
	GameServices::ObjectManager()->GetAutonomousObject(0)->Steering()->WallAvoidanceOff();

	//Check each player object to see if a key press has a force currently applied to the objec
	for(std::vector<IMovingObject*>::iterator it = GameServices::ObjectManager()->GetPlayerList()->begin();
		it != GameServices::ObjectManager()->GetPlayerList()->end(); it++)
	{
		if((*it)->GetAppliedForce() != Ogre::Vector3::ZERO)
		{
			//If it does set the applied force equal to zero
			//This will stop all player movement, in order to resume movement
			//the key must be pressed again
			(*it)->SetAppliedForce(Ogre::Vector3::ZERO);
		}
	}

	running = false;
	GameServices::InputManager()->RemoveListener(this);	//Don't read key strokes
}

void InterposeState::Unpause()
{
	//Turn on interpose
	GameServices::ObjectManager()->GetAutonomousObject(0)->Steering()->InterposeOn(
		GameServices::ObjectManager()->GetPlayerObject(0), GameServices::ObjectManager()->GetPlayerObject(1));

	//Turn wall avoidance on
	GameServices::ObjectManager()->GetAutonomousObject(0)->Steering()->WallAvoidanceOn();

	running = true;
	GameServices::InputManager()->AddListener(this);	//read key strokes again
}

void InterposeState::Execute()
{
}

void InterposeState::Exit()
{
	Ogre::String name;
	
	//Turn off interpose
	GameServices::ObjectManager()->GetAutonomousObject(0)->Steering()->InterposeOff();

	//Turn wall avoidance off
	GameServices::ObjectManager()->GetAutonomousObject(0)->Steering()->WallAvoidanceOff();

	//Destroy the plane scene node
	GameServices::OgreManager()->GetSceneManager()->destroySceneNode("0");

	//Destroy the scene nodes for all other objects
	for(int i = 0; i < INTERPOSE_LAYOUT_SIZE; i++)
	{
		if(bitmap[i])
		{
			name =  Ogre::StringConverter::toString(i+1);
			GameServices::OgreManager()->GetSceneManager()->destroySceneNode(name);
		}
	}	

	//Remove the player object
	GameServices::ObjectManager()->RemovePlayerObject();

	//Remove the autonomous object
	GameServices::ObjectManager()->RemoveAutonomousObject();

	//Remove all wall objects (a negtive number removes all walls)
	GameServices::ObjectManager()->RemoveWall(-1);
	
	//Destroy all remaing entities
	GameServices::OgreManager()->GetSceneManager()->destroyAllEntities();

	Cleanup();
	
	running = false;
}

void InterposeState::Initialize()
{
	mCameraMan = new OgreBites::SdkCameraMan(GameServices::OgreManager()->GetCamera());
	mCameraMan->setStyle(OgreBites::CS_ORBIT);
}

void InterposeState::UpdateStarted(const Ogre::FrameEvent& gameTime)
{
	if(running)
	{
		//Translate the player object
		int i = 0;
		for(std::vector<IMovingObject*>::iterator it = GameServices::ObjectManager()->GetPlayerList()->begin(); 
			it != GameServices::ObjectManager()->GetPlayerList()->end(), i < GameServices::ObjectManager()->GetPlayerObjectCount();
			it++, i++)
		{
			GameServices::OgreManager()->GetSceneManager()->getSceneNode("player" + Ogre::StringConverter::toString(i))->translate(
				GameServices::ObjectManager()->GetPlayerObject(i)->GetVelocity() * gameTime.timeSinceLastFrame);
		}

		//Translate the autonomous object
		i = 0;
		for(std::vector<IMovingObject*>::iterator it = GameServices::ObjectManager()->GetAutonomousList()->begin(); 
			it != GameServices::ObjectManager()->GetAutonomousList()->end(), i < GameServices::ObjectManager()->GetAutonomousObjectCount();
			it++, i++)
		{
			if((*it)->GetVelocity() != Ogre::Vector3::ZERO)
			{
				GameServices::OgreManager()->GetSceneManager()->getSceneNode("auto" + Ogre::StringConverter::toString(i))->translate(
					(*it)->GetVelocity() * gameTime.timeSinceLastFrame);
			}
		}
	}
	mCameraMan->frameRenderingQueued(gameTime);
}

void InterposeState::UpdateEnded(const Ogre::FrameEvent& gameTime)
{

}

void InterposeState::Cleanup()
{
	GameServices::InputManager()->RemoveListener(this);
}

void InterposeState::createScene()
{
	int i = 0, row_count, col_count;
	Ogre::String name;
	std::ifstream inFile;
	int in;

	int x_step = 200;
	int y_step = 200; 
	int windowHeight = GameServices::OgreManager()->GetRenderWindow()->getHeight();
	int windowWidth = GameServices::OgreManager()->GetRenderWindow()->getWidth();

	//Create a plane
	Ogre::SceneNode *aSceneNode(GameServices::OgreManager()->GetSceneManager()->getRootSceneNode()->createChildSceneNode("0"));
	Ogre::Entity *aSphere(GameServices::OgreManager()->GetSceneManager()->createEntity("0", Ogre::SceneManager::PrefabType::PT_PLANE));
	aSceneNode->attachObject(aSphere);
	aSceneNode->setScale(100, 100, 1);
	aSceneNode->setPosition(0, 0, 0);


	inFile.open("../../res/Layout03_Interpose.txt");
	//Place objects on the screen based on the bit map
	for(row_count = 0; row_count < INTERPOSE_LAYOUT_ROWS; row_count++)
	{
		for(col_count = 0; col_count < INTERPOSE_LAYOUT_COLS; col_count++)
		{
			if(!inFile.eof())
			{
				inFile >> in;
				if(in == 1)
				{
					//place an object at point on screen
					name = Ogre::StringConverter::toString(i+1);
					aSceneNode = GameServices::OgreManager()->GetSceneManager()->getRootSceneNode()->createChildSceneNode(name);
					name = Ogre::StringConverter::toString(i+1);
					aSphere = GameServices::OgreManager()->GetSceneManager()->createEntity(name , "cube.mesh");
					aSceneNode->attachObject(aSphere);
					aSceneNode->setScale(1,1,1);
					aSceneNode->setPosition((-7000 + (col_count * x_step)), -(row_count * y_step), 1);
				}
				else
				{
					bitmap[i] = false;	//else don't place a block
				}
				i++;
			}
		}
	}
	inFile.close();

	//Create 4 walls to bound the level
	GameServices::ObjectManager()->AddWall(Ogre::Vector3(-5000,5000,0), Ogre::Vector3(-5000,-5000,0), Ogre::Vector3::ZERO, Ogre::Vector3::ZERO);
	GameServices::ObjectManager()->AddWall(Ogre::Vector3(-5000,-5000,0), Ogre::Vector3(5000,-5000,0), Ogre::Vector3::ZERO, Ogre::Vector3::ZERO);
	GameServices::ObjectManager()->AddWall(Ogre::Vector3(5000,-5000,0), Ogre::Vector3(5000,5000,0), Ogre::Vector3::ZERO, Ogre::Vector3::ZERO);
	GameServices::ObjectManager()->AddWall(Ogre::Vector3(5000,5000,0), Ogre::Vector3(-5000,5000,0), Ogre::Vector3::ZERO, Ogre::Vector3::ZERO);

	//Add a 1 player object
	GameServices::ObjectManager()->AddPlayerObject(1000,1000,0);

	//Add a 2 player object
	GameServices::ObjectManager()->AddPlayerObject(-1000,1000,0);

	//Add an Autonomous object to the scene
	GameServices::ObjectManager()->AddAutonomousObject(0, 0, 0);

	//Turn the interpose beahvior on
	GameServices::ObjectManager()->GetAutonomousObject(0)->Steering()->InterposeOn(
		GameServices::ObjectManager()->GetPlayerObject(0),GameServices::ObjectManager()->GetPlayerObject(1));

	//Turn wall avoidance on
	GameServices::ObjectManager()->GetAutonomousObject(0)->Steering()->WallAvoidanceOn();
}

void InterposeState::OnKeyDown(const OIS::KeyCode& key)
{
	switch(key)
	{
	case OIS::KC_ESCAPE:
		GameServices::GameEngine()->ShutDown();
		break;
	case OIS::KC_0:
		Exit();
		GameServices::StateManager()->ChangeState(SEEK, INTERPOSE);
		break;
	case OIS::KC_1:
		Exit();
		GameServices::StateManager()->ChangeState(PURSUIT, INTERPOSE);
		break;
	case OIS::KC_2:
		Exit();
		GameServices::StateManager()->ChangeState(ARRIVE, INTERPOSE);
		break;
	case OIS::KC_4:
		Exit();
		GameServices::StateManager()->ChangeState(OFFSETPURSUIT, INTERPOSE);
		break;
	case OIS::KC_5:
		Exit();
		GameServices::StateManager()->ChangeState(FLEE, INTERPOSE);
		break;
	case OIS::KC_6:
		Exit();
		GameServices::StateManager()->ChangeState(EVADE, INTERPOSE);
		break;
	case OIS::KC_7:
		Exit();
		GameServices::StateManager()->ChangeState(HIDE, INTERPOSE);
		break;
	case OIS::KC_8:
		Exit();
		GameServices::StateManager()->ChangeState(WALLAVOID, INTERPOSE);
		break;
	case OIS::KC_9:
		Exit();
		GameServices::StateManager()->ChangeState(PATHFOLLOWING, INTERPOSE);
		break;
	case OIS::KC_F1:
		Exit();
		GameServices::StateManager()->ChangeState(WANDER, INTERPOSE);
		break;
	case OIS::KC_F2:
		Exit();
		GameServices::StateManager()->ChangeState(SEPERATION, INTERPOSE);
		break;
	case OIS::KC_F3:
		Exit();
		GameServices::StateManager()->ChangeState(ALIGNMENT, INTERPOSE);
		break;
	case OIS::KC_F4:
		Exit();
		GameServices::StateManager()->ChangeState(COHESION, INTERPOSE);
		break;
	case OIS::KC_F5:
		Exit();
		GameServices::StateManager()->ChangeState(FLOCKING, INTERPOSE);
		break;
	case OIS::KC_F6:
		Exit();
		GameServices::StateManager()->ChangeState(SEEKEVADE, SEEK);
		break;
	case OIS::KC_P:
		if(this->running)
		{
			this->Pause();
			GameServices::StateManager()->ChangeState(PAUSE, INTERPOSE);
		}
		break;
	//Player 1 controls
	case OIS::KC_W:										//Positive Y
		//Debug
		if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_W pressed");
		}

		//Set a force pushing in the y direction on the player object and add it to existing forces
		GameServices::ObjectManager()->GetPlayerObject(0)->SetAppliedForce(
			GameServices::ObjectManager()->GetPlayerObject(0)->GetAppliedForce() + Ogre::Vector3(0,1000,0));
		

		if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" !--!--!--!--!--!--!-POSITIVE Y SELECTED-!--!--!--!--!--!--!");
		}

		break;
	case OIS::KC_A:										//Negative X
		//Debug
		if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_A pressed");
		}

		//Set a force pushing in the -x direction on the player object and add it to existing forces
		GameServices::ObjectManager()->GetPlayerObject(0)->SetAppliedForce(
			GameServices::ObjectManager()->GetPlayerObject(0)->GetAppliedForce() + Ogre::Vector3(-1000,0,0));

		if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" !--!--!--!--!--!--!-NEGATIVE SELECTED-!--!--!--!--!--!--!");
		}

		break;
	case OIS::KC_S:										//Negative Y
		//Debug
		if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_S pressed");
		}

		//Set a force pushing in the -y direction on the player object and add it to existing forces
		GameServices::ObjectManager()->GetPlayerObject(0)->SetAppliedForce(
			GameServices::ObjectManager()->GetPlayerObject(0)->GetAppliedForce() + Ogre::Vector3(0,-1000,0));

		if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" !--!--!--!--!--!--!-NEGATIVE Y SELECTED-!--!--!--!--!--!--!");
		}

		break;
	case OIS::KC_D:										//Positive X
		//Debug
		if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_D pressed");
		}

		//Set a force pushing in the x direction on the player object and add it to existing forces
		GameServices::ObjectManager()->GetPlayerObject(0)->SetAppliedForce(
			GameServices::ObjectManager()->GetPlayerObject(0)->GetAppliedForce() + Ogre::Vector3(1000,0,0));

		if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" !--!--!--!--!--!--!-POSITIVE X SELECTED-!--!--!--!--!--!--!");
		}

		break;
	//Player 2 controls
	case OIS::KC_I:										//Positive Y
		//Debug
		if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_I pressed");
		}

		//Set a force pushing in the y direction on the player object and add it to existing forces
		GameServices::ObjectManager()->GetPlayerObject(1)->SetAppliedForce(
			GameServices::ObjectManager()->GetPlayerObject(1)->GetAppliedForce() + Ogre::Vector3(0,1000,0));
		

		if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" !--!--!--!--!--!--!-POSITIVE Y SELECTED-!--!--!--!--!--!--!");
		}

		break;
	case OIS::KC_J:										//Negative X
		//Debug
		if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_J pressed");
		}

		//Set a force pushing in the -x direction on the player object and add it to existing forces
		GameServices::ObjectManager()->GetPlayerObject(1)->SetAppliedForce(
			GameServices::ObjectManager()->GetPlayerObject(1)->GetAppliedForce() + Ogre::Vector3(-1000,0,0));

		if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" !--!--!--!--!--!--!-NEGATIVE SELECTED-!--!--!--!--!--!--!");
		}

		break;
	case OIS::KC_K:										//Negative Y
		//Debug
		if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_K pressed");
		}

		//Set a force pushing in the -y direction on the player object and add it to existing forces
		GameServices::ObjectManager()->GetPlayerObject(1)->SetAppliedForce(
			GameServices::ObjectManager()->GetPlayerObject(1)->GetAppliedForce() + Ogre::Vector3(0,-1000,0));

		if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" !--!--!--!--!--!--!-NEGATIVE Y SELECTED-!--!--!--!--!--!--!");
		}

		break;
	case OIS::KC_L:										//Positive X
		//Debug
		if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_L pressed");
		}

		//Set a force pushing in the x direction on the player object and add it to existing forces
		GameServices::ObjectManager()->GetPlayerObject(1)->SetAppliedForce(
			GameServices::ObjectManager()->GetPlayerObject(1)->GetAppliedForce() + Ogre::Vector3(1000,0,0));

		if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" !--!--!--!--!--!--!-POSITIVE X SELECTED-!--!--!--!--!--!--!");
		}

		break;
	case OIS::KC_B:	
		//JUST FOR DEBUGGING PRESS TO CALL BREAKPOINT
		if(GameServices::GameEngine()->GetLoggingLevel() == 5)
		{
			Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" I NEED A BREAK ");
		}			
		break;
	}
	//mCameraMan->injectKeyDown(key); //notify the camera man object of a key event

}

void InterposeState::OnKeyUp(const OIS::KeyCode& key)
{
	switch(key)
	{
		//Player 1 release
		case OIS::KC_W:
			//Debug
			if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_W released");
			}

			GameServices::ObjectManager()->GetPlayerObject(0)->SetAppliedForce(
				GameServices::ObjectManager()->GetPlayerObject(0)->GetAppliedForce() + Ogre::Vector3(0,-1000,0));

			if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" @!@!@!@!@!@!@! POSITIVE Y RELEASED !@!@!@!@!@!@!@");
			}

			break;
		case OIS::KC_A:
			//Debug
			if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_A released");
			}

			GameServices::ObjectManager()->GetPlayerObject(0)->SetAppliedForce(
				GameServices::ObjectManager()->GetPlayerObject(0)->GetAppliedForce() + Ogre::Vector3(1000,0,0));

			if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" @!@!@!@!@!@!@! NEGATIVE X RELEASED !@!@!@!@!@!@!@");
			}

			break;
		case OIS::KC_S:
			//Debug
			if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_S released");
			}

			GameServices::ObjectManager()->GetPlayerObject(0)->SetAppliedForce(
				GameServices::ObjectManager()->GetPlayerObject(0)->GetAppliedForce() + Ogre::Vector3(0,1000,0));

			if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" @!@!@!@!@!@!@! NEGATIVE Y RELEASED !@!@!@!@!@!@!@");
			}

			break;
		case OIS::KC_D:
			//Debug
			if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_D released");
			}

			GameServices::ObjectManager()->GetPlayerObject(0)->SetAppliedForce(
				GameServices::ObjectManager()->GetPlayerObject(0)->GetAppliedForce() + Ogre::Vector3(-1000,0,0));

			if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" @!@!@!@!@!@!@! POSITIVE X RELEASED !@!@!@!@!@!@!@");
			}
			break;
		//Player 2 release
		case OIS::KC_I:
			//Debug
			if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_I released");
			}

			GameServices::ObjectManager()->GetPlayerObject(1)->SetAppliedForce(
				GameServices::ObjectManager()->GetPlayerObject(1)->GetAppliedForce() + Ogre::Vector3(0,-1000,0));

			if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" @!@!@!@!@!@!@! POSITIVE Y RELEASED !@!@!@!@!@!@!@");
			}

			break;
		case OIS::KC_J:
			//Debug
			if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_J released");
			}

			GameServices::ObjectManager()->GetPlayerObject(1)->SetAppliedForce(
				GameServices::ObjectManager()->GetPlayerObject(1)->GetAppliedForce() + Ogre::Vector3(1000,0,0));

			if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" @!@!@!@!@!@!@! NEGATIVE X RELEASED !@!@!@!@!@!@!@");
			}

			break;
		case OIS::KC_K:
			//Debug
			if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_K released");
			}

			GameServices::ObjectManager()->GetPlayerObject(1)->SetAppliedForce(
				GameServices::ObjectManager()->GetPlayerObject(1)->GetAppliedForce() + Ogre::Vector3(0,1000,0));

			if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" @!@!@!@!@!@!@! NEGATIVE Y RELEASED !@!@!@!@!@!@!@");
			}

			break;
		case OIS::KC_L:
			//Debug
			if(GameServices::GameEngine()->GetLoggingLevel() >= 3)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage("KC_L released");
			}

			GameServices::ObjectManager()->GetPlayerObject(1)->SetAppliedForce(
				GameServices::ObjectManager()->GetPlayerObject(1)->GetAppliedForce() + Ogre::Vector3(-1000,0,0));

			if(GameServices::GameEngine()->GetLoggingLevel() >= 4)
			{
				Ogre::LogManager::getSingleton().getLog("Dlog.txt")->logMessage(" @!@!@!@!@!@!@! POSITIVE X RELEASED !@!@!@!@!@!@!@");
			}

			break;
	}

	//mCameraMan->injectKeyUp(key); //notify the camera man object of a key event
}

void InterposeState::OnKeyHeld(const OIS::KeyCode& key)
{}

void InterposeState::OnMouseDown(const OIS::MouseState& mouse, const OIS::MouseButtonID& id)
{
	//mCameraMan->injectMouseDown(mouse, id); //notify the camera man object of a key event
}

void InterposeState::OnMouseUp(const OIS::MouseState& mouse, const OIS::MouseButtonID& id)
{
	//mCameraMan->injectMouseUp(mouse, id); //notify the camera man object of a key event
}

void InterposeState::OnMouseHeld(const OIS::MouseState& mouse, const OIS::MouseButtonID& id)
{}

void InterposeState::OnMouseMoved(const OIS::MouseState& mouse)
{
	//mCameraMan->injectMouseMove(mouse); //notify the camera man object of a key event
}


